#include "config.h"


// 定义 MQTT 参数为变量
char MQTT_IP[100] = "broker-cn.emqx.io";  // MQTT 服务器地址
uint16_t PORT = 1883;                     // MQTT 服务器端口
char MQTT_USER[50] = "test1";            // MQTT 用户名
char MQTT_PASSWORD[50] = "12345678";     // MQTT 密码

char device_name[15] = "";  // 可在运行时修改
bool OwnerMode = 1;             // 0 表示女朋友的小电视，1 表示我的小电视，可以在配网页面修改，烧录一个程序就行

char IN_TOPIC[100];          // 想你接收主题
char OUT_TOPIC[100];         //想你发送主题
char LOCALTOPIC[100];        //音频数据接收传输
char PUBTOPIC[100];          //音频数据发送传输
char LOCALTOPIC_1[100];      //音频数据接收传输
char PUBTOPIC_1[100];        //音频数据发送传输
char LOCAL_statusTopic[100]; //状态判断接收主题
char PUB_statusTopic[100];   //状态判断发送主题
const uint16_t* MY_profilphoto;    //我的头像
const uint16_t* COUPLE_profilphoto;//对象头像

void configureTopics() {
    if (OwnerMode == 0) {
        // 女朋友的小电视
        snprintf(IN_TOPIC, sizeof(IN_TOPIC), "%s_ESP32_SENDER/miss", device_name);
        snprintf(OUT_TOPIC, sizeof(OUT_TOPIC), "%s_ESP32_RECVER/miss", device_name);
        snprintf(LOCALTOPIC, sizeof(LOCALTOPIC), "%s_ESP32_SENDER/i2s", device_name);
        snprintf(PUBTOPIC, sizeof(PUBTOPIC), "%s_ESP32_RECVER/i2s", device_name);
        snprintf(LOCALTOPIC_1, sizeof(LOCALTOPIC_1), "%s_ESP32_SENDER/invate", device_name);
        snprintf(PUBTOPIC_1, sizeof(PUBTOPIC_1), "%s_ESP32_RECVER/invate", device_name);
        snprintf(LOCAL_statusTopic, sizeof(LOCAL_statusTopic), "%s_ESP32_SENDER/status", device_name);
        snprintf(PUB_statusTopic, sizeof(PUB_statusTopic), "%s_ESP32_RECVER/status", device_name);
        MY_profilphoto = touxiang_1;       // 指向 touxiang_1 数据
        COUPLE_profilphoto = touxiang_2;  // 指向 touxiang_2 数据
    } else {
        // 我的电视
        snprintf(IN_TOPIC, sizeof(IN_TOPIC), "%s_ESP32_RECVER/miss", device_name);
        snprintf(OUT_TOPIC, sizeof(OUT_TOPIC), "%s_ESP32_SENDER/miss", device_name);
        snprintf(LOCALTOPIC, sizeof(LOCALTOPIC), "%s_ESP32_RECVER/i2s", device_name);
        snprintf(PUBTOPIC, sizeof(PUBTOPIC), "%s_ESP32_SENDER/i2s", device_name);
        snprintf(LOCALTOPIC_1, sizeof(LOCALTOPIC_1), "%s_ESP32_RECVER/invate", device_name);
        snprintf(PUBTOPIC_1, sizeof(PUBTOPIC_1), "%s_ESP32_SENDER/invate", device_name);
        snprintf(LOCAL_statusTopic, sizeof(LOCAL_statusTopic), "%s_ESP32_RECVER/status", device_name);
        snprintf(PUB_statusTopic, sizeof(PUB_statusTopic), "%s_ESP32_SENDER/status", device_name);
        MY_profilphoto = touxiang_2;       // 指向 touxiang_2 数据
        COUPLE_profilphoto = touxiang_1;  // 指向 touxiang_1 数据
    }
}
